﻿@model MobileSales.Model.Tasks.Schedule

@{
    View.Title = Strings.Schedules + " - " + Strings.Details;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@Strings.Schedules &nbsp;&raquo;&nbsp; @Strings.Details</h2>

<fieldset>
    <legend>@Strings.Fields</legend>

    <div class="display-label">@ModelStrings.Employee</div>
    <div class="display-field">@Html.EmployeeIdentity(Model.EmployeeId)</div>

    <div class="display-label">@ModelStrings.CreationDate</div>
    <div class="display-field">@String.Format("{0:g}", Model.CreationDate)</div>

    <div class="display-label">@ModelStrings.ModificationDate</div>
    <div class="display-field">@String.Format("{0:g}", Model.ModificationDate)</div>

    <div class="display-label">@ModelStrings.StartTime</div>
    <div class="display-field">@String.Format("{0:g}", Model.StartTime)</div>

    <div class="display-label">@ModelStrings.EndTime</div>
    <div class="display-field">@String.Format("{0:g}", Model.EndTime)</div>

    <div class="display-label">@ModelStrings.RealStartTime</div>
    <div class="display-field">@String.Format("{0:g}", Model.RealStartTime)</div>

    <div class="display-label">@ModelStrings.RealEndTime</div>
    <div class="display-field">@String.Format("{0:g}", Model.RealEndTime)</div>

    <div class="display-label">@ModelStrings.StartPositionLatitude</div>
    <div class="display-field">@String.Format("{0:F}", Model.StartPositionLatitude)</div>

    <div class="display-label">@ModelStrings.StartPositionLongitude</div>
    <div class="display-field">@String.Format("{0:F}", Model.StartPositionLongitude)</div>

    <div class="display-label">@ModelStrings.EndPositionLatitude</div>
    <div class="display-field">@String.Format("{0:F}", Model.EndPositionLatitude)</div>

    <div class="display-label">@ModelStrings.EndPositionLongitude</div>
    <div class="display-field">@String.Format("{0:F}", Model.EndPositionLongitude)</div>
    
    <br /><br />
     @Html.ActionLink(Strings.AddTask, "Create", "Tasks", new { employeeId = Model.EmployeeId }, new { @class = "icon-button add-icon" })
     
    <br /><br />
    <table class="datatable">
        <thead>
        <tr>
            <th style="width:200px"></th>
            
            <th>
                @ModelStrings.Info
            </th>
            <th>
                @ModelStrings.StartTime
            </th>
            <th>
                @ModelStrings.EndTime
            </th>
        </tr></thead>
        <tbody>
        

    @foreach (var task in Model.Tasks)
    {
        <tr>
            <td>
                @Html.ActionLink(Strings.Edit, "Edit", "Tasks", new { id = task.Id, employeeId = Model.EmployeeId }, new { @class = "icon-button edit-icon" }) |
                @Html.ActionLink(Strings.Details, "Details", "Tasks", new { id = task.Id, employeeId = Model.EmployeeId }, new { @class = "icon-button details-icon" })<br /><br />
                @Html.ActionLink(Strings.Delete, "Delete", "Tasks", new { id = task.Id, employeeId = Model.EmployeeId, tskCount = Model.Tasks.Count() }, new { @class = "icon-button delete-icon" })
            </td>
            
            <td>
                @task.Info
            </td>
            <td>
                @String.Format("{0:g}", task.StartTime)
            </td>
            <td>
                @String.Format("{0:g}", task.EndTime)
            </td>
        </tr>
        
    }
    </tbody>
    </table>


</fieldset>
<p>
   @Html.ActionLink(Strings.BackToList, "Index", null, new { @class="icon-button prev-icon" })
</p>
